<?php //tin mới nhất            ?>
<div id="latest-title">
    <span class="title"><?php echo $page_latest_news; ?></span>
    <span class="time">
        <?php
        //show date time Tieng Viet
        $str_search = array(
            "Mon",
            "Tue",
            "Wed",
            "Thu",
            "Fri",
            "Sat",
            "Sun"
        );
        $str_replace = array(
            "Th&#7913; hai",
            "Th&#7913; ba",
            "Th&#7913; t&#432;",
            "Th&#7913; n&#259;m",
            "Th&#7913; s&#225;u",
            "Th&#7913; b&#7843;y",
            "Ch&#7911; nh&#7853;t"
        );
        $timenow = gmdate("D, d/m/Y | H:i", time() + 7 * 3600);
        $timenow = str_replace($str_search, $str_replace, $timenow);
        echo $timenow;
        ?>
    </span>
</div>  
<div id="latest-body"> 
    <div class="bleft">
        <?php
        //Nếu có đủ 7 tin thì mới show.
        if (isset($aLatestNews[0]) && count($aLatestNews) >= 4) {
            //latest news: record 1
            //Nếu tin có parent_cate_url thì mới attach vào.
            $parent_cate_url = "";
            if (isset($aLatestNews[0]->parent_cate_url) && $aLatestNews[0]->parent_cate_url != "")
                $parent_cate_url = $aLatestNews[0]->parent_cate_url . "/";
            ?>
            <a href="<?php echo $base_url . $parent_cate_url . $aLatestNews[0]->news_cate_url . "/" . $aLatestNews[0]->url . "-" . $aLatestNews[0]->news_id; ?>.html"><img src="<?php echo $img_url; ?>style/<?php echo $aLatestNews[0]->img_thumb; ?>" border="0" alt="" width="430px" height="270px"/></a>
            <a href="<?php echo $base_url . $parent_cate_url . $aLatestNews[0]->news_cate_url . "/" . $aLatestNews[0]->url . "-" . $aLatestNews[0]->news_id; ?>.html" class="btitle"><?php echo $aLatestNews[0]->title; ?></a>
            <span class="bcontent"><?php echo $aLatestNews[0]->short_desc; ?></span>
            <div>
                <ul class="blist-2">
                    <?php
                    //latest news: record 5,6,7
                    for ($i = 1; $i < 4; $i++) {
                        //Nếu tin có parent_cate_url thì mới attach vào.
                        $parent_cate_url = "";
                        if (isset($aLatestNews[$i]->parent_cate_url) && $aLatestNews[$i]->parent_cate_url != "")
                            $parent_cate_url = $aLatestNews[$i]->parent_cate_url . "/";
                        ?>
                        <li class="bitem">
                            <a href="<?php echo $base_url . $parent_cate_url . $aLatestNews[$i]->news_cate_url . "/" . $aLatestNews[$i]->url . "-" . $aLatestNews[$i]->news_id; ?>.html">
                                <img src="<?php echo $img_url; ?>style/<?php echo $aLatestNews[$i]->img_thumb2; ?>" border="0"/>
                            </a> 
                            <a href="<?php echo $base_url . $parent_cate_url . $aLatestNews[$i]->news_cate_url . "/" . $aLatestNews[$i]->url . "-" . $aLatestNews[$i]->news_id; ?>.html">
                                <?php echo $aLatestNews[$i]->title; ?>
                            </a>
                        </li>
                        <?php
                    }
                    ?>

                </ul>
            </div>
            <?php
        }
        else { //nếu không đủ 7 tin thì show thông báo.
            ?>
            <div align='center' class='nodata'><?php echo $page_nodata; ?></div>
            <?php
        }
        ?>  
    </div>
    <div class="bright">
        <?php
        // box tin noi bat
        require APPPATH . "views/common/box_news_tin-noi-bat.php"
        ?>
    </div>   
    <div style="height:20px; clear:both;"></div>
</div>
<div id="box-cates">
    <ul>
        <li>
            <?php
            //box Van ban phap quy 
            require APPPATH . "views/common/box_news_vanban.php";
            //box Kien Thuc XNK
            require APPPATH . "views/common/box_news_kienthucxnk.php";
            ?>
        </li>
        <li>
            <?php
            //box Thu Tuc Hai Quan
            require APPPATH . "views/common/box_news_thutuchaiquan.php";
            //box Nghiep Vu Giao Nhan
            require APPPATH . "views/common/box_news_nghiepvugiaonhan.php";
            ?>        
        </li>
        <li>
            <?php
            //box Nghiep Vu Khac 
            //require APPPATH . "views/common/box_news_nghiepvukhac.php";
            //box Rao Vat
            require APPPATH . "views/common/box_rao-vat.php";
            ?>          
        </li>                
    </ul> 
    <div class="clearfix"></div>
</div>  
<?php
//b Hoi Dap
require APPPATH . "views/common/box_faq.php";
//box video
require APPPATH . "views/common/box_video.php";
?>  	
<br><br>  
<div class="clearfix"></div>